package com.eastfair.common.api;

import com.eastfair.core.base.R;
import com.eastfair.pay.dto.CollectDTO;
import com.eastfair.pay.vo.CollectPageDetailVO;
import com.eastfair.pay.dto.UnCollectDTO;
import com.eastfair.pay.vo.CollectRecordVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "mice-pay/collectRecord")
public interface CollectRecordFeign {

    /**
     * 认领
     * @return
     */
    @PostMapping("/collect")
    R collect(@RequestBody CollectDTO collectDTO);

    /**
     * 取消认领
     * @return
     */
    @PostMapping("/uncollect")
    R uncollect(@RequestBody UnCollectDTO unCollectDTO);

    /**
     * 获取付款计划认领记录
     * @param paymentPlanId
     * @return
     */
    @RequestMapping(value="/queryCollectByPlanId/{paymentPlanId}",method=RequestMethod.GET)
    R<List<CollectRecordVO>> queryCollectByPlanId(@PathVariable("paymentPlanId") Long paymentPlanId);

    /**
     * 获取付款记录认领记录
     * @param recordId
     * @return
     */
    @RequestMapping(value="/queryCollectByRecordId/{recordId}",method=RequestMethod.GET)
    R<List<CollectRecordVO>> queryCollectByRecordId(@PathVariable("recordId") Long recordId);


    /**
     * 通过合同获取认领页面详情
     * @param businessId
     * @return
     */
    @RequestMapping(value="/queryCollectPageDetail/{businessId}",method=RequestMethod.GET)
    R<CollectPageDetailVO> getCollectPageDetail(@PathVariable("businessId") Long businessId);

    /**
     * @Author clm
     * @Description //通过主键获取认领详情
     * @Date 15:58 2023/2/24
     * @Param [recordId]
     * @return com.eastfair.core.base.R<com.eastfair.pay.vo.CollectRecordVO>
     **/
    @GetMapping("/getCollectRecordById/{recordId}")
    R<CollectRecordVO> getCollectRecordById(@PathVariable("recordId") Long recordId);
}
